function trigger = triggerGen(t0,sz,tend)

    len = length(t0:sz:tend);
    trigger(1,:) = zeros(1,len);% training
    trigger(2,:) = zeros(1,len);%test
   
    % Training
    train10 = [4000]; % ms start training
    train11 = [6000]; % ms end training 
    
    % Test
    test10 = [7500 8500 10000]; % ms start training
    test11 = [8000 9500 11000]; % ms end training 
    
    for i = 1:length(train10)
        trigger(1,train10(i)/sz:train11(i)/sz) = 1*ones(1,length(train10(i)/sz:train11(i)/sz));    
    end
    for i = 1:length(test10)
        trigger(2,test10(i)/sz:test11(i)/sz) = 1*ones(1,length(test10(i)/sz:test11(i)/sz));        
    end
end